﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Simple.Services.MQTT.Model
{


    public class Info
    {
        /// <summary>
        /// 平台生成的 id,
        /// </summary>
        public string customId { get; set; }
        /// <summary>
        /// 人员名字
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 民族
        /// </summary>
        public int nation { get; set; }
        /// <summary>
        ///  性别 0: 男 1: 女
        /// </summary>
        public int gender { get; set; }
        /// <summary>
        /// 生日
        /// </summary>
        public DateTime? birthday { get; set; }
        /// <summary>
        /// 地址
        /// </summary>
        public string address { get; set; }
        /// <summary>
        /// 证件号码
        /// </summary>
        public string idCard { get; set; }

        /// <summary>
        /// 名单类型
        ///0:永久名单
        ///1:临时名单 1(时间段有效)
        ///2:临时名单 2(每天同一时间段有效)
        ///3:临时名单 3(次数有效)
        ///4:临时名单 4（每天同一时间段有效或者次数有效）
        /// </summary>
        public int tempCardType { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int EffectNumber { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public DateTime? cardValidBegin { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public DateTime? cardValidEnd { get; set; }
        /// <summary>
        /// 电话号码
        /// </summary>
        public string telnum1 { get; set; }
        /// <summary>
        /// 籍贯
        /// </summary>
        public string native { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int cardType2 { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string notes { get; set; }
        /// <summary>
        /// 0: 白名单 1: 黑名单
        /// </summary>
        public int personType { get; set; }
        /// <summary>
        /// 证件类型：0 身份证
        /// </summary>
        public int cardType { get; set; }


        public long RFIDCard { get; set; }
        /// <summary>
        /// 照片Url全路径
        /// </summary>
        public string picURI { get; set; }

        /// <summary>
        /// 韦根门禁卡号
        /// </summary>
        public long cardNum2 { get; set; }
    }

    public class MqttPersOutModel
    {
        /// <summary>
        /// AddPersons/AddPersons-Ack   AddPersons:批量增加人员  AddPersons-Ack:批量增加人员返回
        /// </summary>
        public string Operator { get; set; }

        /// <summary>
        /// 消息 id,区分每一条消息
        /// </summary>
        public string messageId { get; set; }


        /// <summary>
        /// 人员数目,必须和对应人员信息 json 个数一致
        /// </summary>
        public int PersonNum { get; set; }

        public List<Info> info { get; set; }

        public string DataBegin { get; set; } = "BeginFlag";

        public string DataEnd { get; set; } = "EndFlag";
    }


    public class RecPushResult
    {


        public RecPushModel info { get; set; }
    }

    public class SnapResult
    {
        public string Operator { get; set; }
    }

    public class RecPushModel
    {
        public string customId { get; set; }
        public string personId { get; set; }

        public string RecordID { get; set; }

        /// <summary>
        /// 认证结果 1：允许 2：拒绝
        /// </summary>
        public string VerifyStatus { get; set; }

        public int PersonType { get; set; }

        /// <summary>
        /// 出入口方向 进口:"entr" ，出口:"exit" ,无方向: "unknow"
        /// </summary>
        public string direction { get; set; }


        public DateTime time { get; set; }

        /// <summary>
        /// 内置读卡机卡号
        /// </summary>
        public string RFIDCard { get; set; }

        public string cardNum2 { get; set; }

        public string pic { get; set; }

        /// <summary>
        /// 电话号码
        /// </summary>
        public string telnum { get; set; }

        public string facesluiceId { get; set; }

        public string persionName { get; set; }

        public string idCard { get; set; }


    }


    public class DleMQTTModel
    {
        public string Operator { get; set; }

        public string messageId { get; set; }

        public List<DleMQTTInfoModel> info { get; set; }
    }

    public class DleMQTTInfoModel
    {
        public string deleteall { get; set; }
    }


    public class MorningCheckDto
    {
        public string from { get; set; }

        public MorningCheckDataDto data { get; set; }
    }

    public class MorningCheckDataDto
    {
        public string cmd { get; set; }

        public string user_id { get; set; }

        public string name { get; set; }

        public string face_template { get; set; }

        /// <summary>
        /// 人员有效期（人员在这个时间点后，无法通行）格式：yyyy-MM-dd 或者 yyyy-MM-dd HH:mm，为 “” 则为永久
        /// </summary>
        public string id_valid { get; set; } = "";
    }

    public class SyncDataCallBackDto
    {
        public string messageId { get; set; }

        public SyncDataCallBackInfo info { get; set; }
    }

    public class SyncDataCallBackInfo
    {
        /// <summary>
        /// 失败数量
        /// </summary>
        public string AddErrNum { get; set; }

        /// <summary>
        /// 成功数量
        /// </summary>
        public string AddSucNum { get; set; }

        public List<ErrInfo> AddErrInfo { get; set; }
    }

    public class ErrInfo
    {
        public string customId { get; set; }

        public string errcode { get; set; }
    }

    public class MorningCheckSyncResultDto
    {
        public string to { get; set; }

        public MorningCheckSyncResultDataDto data { get; set; }
    }

    public class MorningCheckSyncResultDataDto
    {

        public int code { get; set; }
        public string msg { get; set; }
    }

    public class SyncResult
    {
        /// <summary>
        /// 考勤结果
        /// </summary>
        public string ClockingInMessage { get; set; }

        /// <summary>
        /// 晨检结果
        /// </summary>
        public string MorningCheckMessage { get; set; }
    }

}


